package fr.ajicommerce.core.dao.implementation;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import fr.ajicommerce.core.dao.generics.GenericDAO;
import fr.ajicommerce.core.dao.interfaces.ICommandeDAO;
import fr.ajicommerce.core.entities.Commande;

@Component("commandeDAO")
@Transactional
public class CommandeDAO extends GenericDAO<Commande, Long> implements
ICommandeDAO{
	
	public CommandeDAO(Class<Commande> entityClass) {
		super(entityClass);
	}

	public CommandeDAO() {
		super(Commande.class);
	}

	@Override
	public Commande findCommandeByRef(String refCommande) {

		Map<String, Object> parameters = new HashMap<String, Object>();
		parameters.put("refCommande", refCommande);

		return super.findOneResult(Commande.FIND_BY_REF_COMMANDE, parameters);
	}


}
